import Vue from 'vue'
import Antd from 'ant-design-vue'
import App from './App.vue'
import router from './router'
import store from './store'
import 'ant-design-vue/dist/antd.css'

// 验证器
import { ValidationProvider, extend, setInteractionMode } from 'vee-validate'
import { required, email } from 'vee-validate/dist/rules'

setInteractionMode('lazy')

extend('required', {
  ...required,
  message: '此表单必填',
})
extend('email', {
  ...email,
  message: '邮箱格式不正确',
  // validate: (value) => {
  //   return /^[\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])?$/.test(
  //     value
  //   )
  // },
})
Vue.component('ValidationProvider', ValidationProvider)

Vue.use(Antd)

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: (h) => h(App),
}).$mount('#app')
